package com.itbaizhan.dao;
/*用mybatis注解 不用sqlMapConfig.xmls配置信息*/

import com.itbaizhan.domain.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

//注解   用于创建对象，放入Spring容器，相当于<bean id="" class="">
@Repository
public interface StudentDao {
    //查询所有学生
    @Select("select * from student")
    List<Student> findAll();
    //添加学生
    @Insert("insert into student values(null,#{name},#{sex},#{address})")
    void add(Student student);
}
